DATA SEGMENT
    ARRY DW 1,2,3,4,5,6,7,8,9,10
    COUNT DW ($-ARRY)/2
    SUM DW 0
    NUM DW 0
DATA ENDS
CODE SEGMENT
MAIN PROC FAR
    ASSUME CS:CODE,DS:DATA
    MOV AX,DATA
    MOV DS,AX
    CALL ARRYADD
    CALL DISPLAY
    MOV AH,4CH
    INT 21H
MAIN ENDP
ARRYADD PROC NEAR
    PUSH SI
    PUSH AX
    PUSH BX
    PUSH CX
    XOR AX,AX
    LEA SI,ARRY
    MOV CX,COUNT
L1:
    ADD AX,[SI]
    ADD SI,2
    LOOP L1
    MOV SUM,AX
    POP CX
    POP BX
    POP AX
    POP SI
    RET
ARRYADD ENDP
DISPLAY PROC NEAR
    PUSH AX
    PUSH BX
    PUSH CX
    MOV AX,SUM
L2:
    XOR DX,DX
    MOV CX,10
    IDIV CX
    PUSH DX
    INC NUM
    CMP AX,0
    JNE L2
L3:
    POP DX
    ADD DX,30H
    DEC NUM
    CMP NUM,0
    MOV AH,02H
    INT 21H
    JNE L3
    POP CX
    POP BX
    POP AX
    RET
DISPLAY ENDP
CODE ENDS
END MAIN